#include<stdio.h>
void Sort(struct student* stu, int n);
struct student
{
	char name[10];
	char sex;
	int age;
	float score;
};
int main()
{
	struct student stu[45];
	int i, n;
	int maxScore;
	scanf("%d", &n);
	getchar();
	for (i = 0; i < n; i++) {
		gets_s(stu[i].name);
		scanf("%c", &stu[i].sex);
		scanf("%d", &stu[i].age);
		scanf("%f", &stu[i].score);
		getchar();
	}
	Sort(stu, n);

}
void Sort(struct student stu[], int n)
{
	int i;
	int max;
	float maxScore = stu[0].score;
	for (i = 1; i < n ; i++)
		if (stu[i].score > maxScore)
			max = i;
	printf("\nName\t\tSex\tAge\tScore\n");
    printf("%s\t\t%c\t%d\t%5.1f\n",stu[max].name, stu[max].sex, stu[max].age, stu[max].score);
}